package com.qhd.beo.wechat.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.servlet.ModelAndView;

import com.qhd.beo.entity.Order;
import com.qhd.beo.inter.IOrderService;


@Controller
@RequestMapping("/Order")
public class OrderController {
	
	private IOrderService orderService;
	
	@Autowired
	public void setOrderService(IOrderService orderService) {
		this.orderService = orderService;
	}

	@RequestMapping(value="/{id}",method=RequestMethod.GET)
	public ModelAndView getOrder(@PathVariable Long id){
		
		Order order = orderService.getOrderById(id);
		ModelAndView view = new ModelAndView("test");
		view.addObject("Order", order);
		view.addObject("msg","test out message");
		
		return view;
	}

}
